home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / NDK / NDK_3.5 / Documentation / Autodocs / printer.doc < prev    next >
Encoding:
Text File  |  1999-10-29  |  52.6 KB  |  1,374 lines

  1. TABLE OF CONTENTS
  2.  
  3. printer.device/--background--
  4. printer.device/CallErrHook
  5. printer.device/CMD_FLUSH
  6. printer.device/CMD_INVALID
  7. printer.device/CMD_RESET
  8. printer.device/CMD_START
  9. printer.device/CMD_STOP
  10. printer.device/CMD_WRITE
  11. printer.device/PBothReady
  12. printer.device/PRD_DUMPRPORT
  13. printer.device/PRD_DUMPRPORTTAGS
  14. printer.device/PRD_EDITPREFS
  15. printer.device/PRD_PRTCOMMAND
  16. printer.device/PRD_QUERY
  17. printer.device/PRD_RAWWRITE
  18. printer.device/PRD_READPREFS
  19. printer.device/PRD_SETERRHOOK
  20. printer.device/PRD_WRITEPREFS
  21. printer.device/PQuery
  22. printer.device/PRead
  23. printer.device/PWrite
  24. printer.device/--background--                   printer.device/--background--
  25.  
  26. The printer.device gots a lot of new features with V44:
  27.  
  28.     - It is now possible to print hi- and true-color bitmaps
  29.     - Planar bitmaps are read faster
  30.     - Much more stable if wrong parameters for PRD_DUMPRPORT are used
  31.     - A lot of new features for printer drivers are supported.
  32.     
  33.     Creating a driver for printer.device now gets much easier: the driver
  34.     does not have to scale the bitmap anymore and can use its own 
  35.     algorithms for nearly everything (color conversion, color correction,
  36.     all dither methods, anti aliasing). The driver is now run in a
  37.     DOS process instead of a exec task so loading preferences or saving
  38.     the output to a file is not longer a multithreading task.
  39.     
  40.     The driver gives more information for the preferences user interface
  41.     (names of dither algorithms, names of shading algorithms, information
  42.     about density interpretation) and for the printing itself (left and
  43.     top border on paper, more page formats).
  44.     
  45.     Drivers can have its own preferences which can be edited and
  46.     stored from every application. Driver can also have its own 
  47.     preferences editor (like PrinterPS).
  48. printer.device/CallErrHook                         printer.device/CallErrHook
  49.  
  50.    NAME
  51.     CallErrHook -- internal call of error hook
  52.    
  53.    SYNOPSIS
  54.     result = (*PrinterData->pd_CallErrHook)(hook, iorequest, msg);
  55.     D0
  56.     
  57.     LONG CallErrHook(struct Hook *, struct IORequest *, struct PrtErrMsg *);
  58.  
  59.    FUNCTION
  60.     An application can set an error hook that is called in case of
  61.     errors to display an formated and localized error message to the
  62.     user. The driver can set an error hook to format and localize
  63.     custom error messages and to call the application's error hook. This
  64.     is done by calling PD->pd_CallErrHook() from the printer.device.
  65.     CallErrHook will do additional formating like setting a title of
  66.     the error message if no is set by the driver and then calls the
  67.     application's error hook.
  68.    
  69.    RESULT
  70.     The return value of the hook is returned from CallErrHook.
  71. printer.device/CMD_FLUSH                             printer.device/CMD_FLUSH
  72.  
  73.    NAME
  74.     CMD_FLUSH -- abort all I/O requests (immediate)
  75.  
  76.    FUNCTION
  77.     CMD_FLUSH aborts all stopped I/O at the unit.
  78.  
  79.    IO REQUEST
  80.     io_Message    mn_ReplyPort set if quick I/O is not possible
  81.     io_Device    preset by the call to OpenDevice
  82.     io_Command    CMD_FLUSH
  83.     io_Flags    IOB_QUICK set if quick I/O is possible
  84. printer.device/CMD_INVALID                         printer.device/CMD_INVALID
  85.  
  86.    NAME
  87.     CMD_INVALID -- invalid command
  88.  
  89.    FUNCTION
  90.     CMD_INVALID is always an invalid command, and sets the device
  91.     error appropriately.
  92.  
  93.    IO REQUEST
  94.     io_Message    mn_ReplyPort set if quick I/O is not possible
  95.     io_Command    CMD_INVALID
  96.     io_Flags    IOB_QUICK set if quick I/O is possible
  97. printer.device/CMD_RESET                             printer.device/CMD_RESET
  98.  
  99.    NAME
  100.     CMD_RESET -- reset the printer
  101.  
  102.    FUNCTION
  103.     CMD_RESET resets the printer device without destroying handles
  104.     to the open device.
  105.  
  106.    IO REQUEST
  107.     io_Message    mn_ReplyPort set if quick I/O is not possible
  108.     io_Device    preset by the call to OpenDevice
  109.     io_Command    CMD_RESET
  110.     io_Flags    IOB_QUICK set if quick I/O is possible
  111. printer.device/CMD_START                             printer.device/CMD_START
  112.  
  113.    NAME
  114.     CMD_START -- restart after stop (immediate)
  115.  
  116.    FUNCTION
  117.     CMD_START restarts the unit after a stop command.
  118.  
  119.    IO REQUEST
  120.     io_Message    mn_ReplyPort set if quick I/O is not possible
  121.     io_Device    preset by the call to OpenDevice
  122.     io_Command    CMD_START
  123.     io_Flags    IOB_QUICK set if quick I/O is possible
  124. printer.device/CMD_STOP                               printer.device/CMD_STOP
  125.  
  126.    NAME
  127.     CMD_STOP -- pause current and queued I/O requests (immediate)
  128.  
  129.    FUNCTION
  130.     CMD_STOP pauses all queued requests for the unit, and tries to
  131.     pause the current I/O request.  The only commands that will
  132.     be subsequently allowed to be performed are immediate I/O
  133.     requests, which include those to start, flush, and finish the
  134.     I/O after the stop command.
  135.  
  136.    IO REQUEST
  137.     io_Message    mn_ReplyPort set if quick I/O is not possible
  138.     io_Device    preset by the call to OpenDevice
  139.     io_Command    CMD_STOP
  140.     io_Flags    IOB_QUICK set if quick I/O is possible
  141. printer.device/CMD_WRITE                             printer.device/CMD_WRITE
  142.  
  143.    NAME
  144.       CMD_WRITE -- send output to the printer
  145.  
  146.    FUNCTION
  147.       This function causes a buffer of characters to be written to the
  148.       current printer port (usually parallel or serial).  The number of
  149.       characters is specified in io_Length, unless -1 is used, in which
  150.       case output is sent until a 0x00 is encountered.
  151.  
  152.       The Printer device, like the Console device, maps ANSI X3.64 style
  153.       7-bit printer control codes to the control code set of the current
  154.       printer.  The ANSI codes supported can be found below.
  155.  
  156.    NOTES
  157.       Not all printers will support all functions.  In particular you may
  158.       not assume that the MARGINS or TABS can be set.  Close to half the
  159.       supported printers don't fully implement one or the other.  If you
  160.       want the features of margins or tabs you will need to fake it
  161.       internally by sending out spaces.
  162.  
  163.       Note that the printer device may have already sent out a "set
  164.       margins" command to the printer.  If you are faking your own
  165.       margins, be sure to cancel the old ones first.  (use the "aCAM"
  166.       command)
  167.  
  168.       Defaults are set up so that if a normal AmigaDOS text file
  169.       is sent to PRT:, it has the greatest chance of working.
  170.       (AmigaDOS text files are defined as follows:)
  171.               tabs            - every 8
  172.               CR (0x0D)       - moves to start of current line
  173.               LF (0x0A)       - moves to start of next line
  174.  
  175.    IO REQUEST
  176.        io_Message      mn_ReplyPort set
  177.        io_Device       preset by OpenDevice
  178.        io_Unit         preset by OpenDevice
  179.        io_Command      CMD_WRITE
  180.        io_Length       number of characters to process, or if -1,
  181.                        process until 0x00 encountered
  182.        io_Data         pointer to block of data to process
  183.  
  184.    RESULTS
  185.        io_Error : if CMD_WRITE succeeded, then io_Error will be zero.
  186.               Otherwise io_Error will be non-zero.
  187.  
  188.    SEE ALSO
  189.        printer.h, parallel.device, serial.device, Preferences
  190.  
  191.  
  192.    ANSI X3.64 style COMMANDS
  193.  
  194.  aRIS         ESCc            hard reset
  195.  aRIN         ESC#1           initialize to defaults
  196.  aIND         ESCD            true linefeed (lf)
  197.  aNEL         ESCE            return,lf
  198.  aRI          ESCM            reverse lf              *
  199.  
  200.  aSGR0        ESC[0m          normal character set
  201.  aSGR3        ESC[3m          italics on
  202.  aSGR23       ESC[23m         italics off
  203.  aSGR4        ESC[4m          underline on
  204.  aSGR24       ESC[24m         underline off
  205.  aSGR1        ESC[1m          boldface on
  206.  aSGR22       ESC[22m         boldface off
  207.  aSFC         SGR30-39        set foreground color
  208.  aSBC         SGR40-49        set background color
  209.  
  210.  aSHORP0      ESC[0w          normal pitch
  211.  aSHORP2      ESC[2w          elite on
  212.  aSHORP1      ESC[1w          elite off
  213.  aSHORP4      ESC[4w          condensed on
  214.  aSHORP3      ESC[3w          condensed off
  215.  aSHORP6      ESC[6w          enlarged on
  216.  aSHORP5      ESC[5w          enlarged off
  217.  
  218.  aDEN6        ESC[6"z         shadow print on
  219.  aDEN5        ESC[5"z         shadow print off
  220.  aDEN4        ESC[4"z         doublestrike on
  221.  aDEN3        ESC[3"z         doublestrike off
  222.  aDEN2        ESC[2"z         Near Letter Quality (NLQ) on
  223.  aDEN1        ESC[1"z         NLQ off
  224.  
  225.  aSUS2        ESC[2v          superscript on
  226.  aSUS1        ESC[1v          superscript off
  227.  aSUS4        ESC[4v          subscript on
  228.  aSUS3        ESC[3v          subscript off
  229.  aSUS0        ESC[0v          normalize the line      *
  230.  aPLU         ESCL            partial line up         *
  231.  aPLD         ESCK            partial line down       *
  232.  
  233.  aFNT0        ESC(B           US char set (default)   or Font 0
  234.  aFNT1        ESC(R           French char set         or Font 1
  235.  aFNT2        ESC(K           German char set         or Font 2
  236.  aFNT3        ESC(A           UK char set             or Font 3
  237.  aFNT4        ESC(E           Danish I char set       or Font 4
  238.  aFNT5        ESC(H           Sweden char set         or Font 5
  239.  aFNT6        ESC(Y           Italian char set        or Font 6
  240.  aFNT7        ESC(Z           Spanish char set        or Font 7
  241.  aFNT8        ESC(J           Japanese char set       or Font 8
  242.  aFNT9        ESC(6           Norweign char set       or Font 9
  243.  aFNT10       ESC(C           Danish II char set      or Font 10
  244.  
  245.  aPROP2       ESC[2p          proportional on         *
  246.  aPROP1       ESC[1p          proportional off        *
  247.  aPROP0       ESC[0p          proportional clear      *
  248.  aTSS         ESC[n E         set proportional offset *
  249.  aJFY5        ESC[5 F         auto left justify       *
  250.  aJFY7        ESC[7 F         auto right justify      *
  251.  aJFY6        ESC[6 F         auto full justify       *
  252.  aJFY0        ESC[0 F         auto justify off        *
  253.  aJFY3        ESC[3 F         letter space (justify)  *
  254.  aJFY1        ESC[1 F         word fill(auto center)  *
  255.  
  256.  aVERP0       ESC[0z          1/8" line spacing
  257.  aVERP1       ESC[1z          1/6" line spacing
  258.  aSLPP        ESC[nt          set form length n
  259.  aPERF        ESC[nq          set perforation skip to n lines (n>0)
  260.  aPERF0       ESC[0q          perforation skip off
  261.  
  262.  aLMS         ESC#9           Left margin set         *
  263.  aRMS         ESC#0           Right margin set        *
  264.  aTMS         ESC#8           Top margin set          *
  265.  aBMS         ESC#2           Bottom margin set       *
  266.  aSTBM        ESC[Pn1;Pn2r    set T&B margins         *
  267.  aSLRM        ESC[Pn1;Pn2s    set L&R margin          *
  268.  aCAM         ESC#3           Clear margins
  269.  
  270.  aHTS         ESCH            Set horiz tab           *
  271.  aVTS         ESCJ            Set vertical tabs       *
  272.  aTBC0        ESC[0g          Clr horiz tab           *
  273.  aTBC3        ESC[3g          Clear all h tab         *
  274.  aTBC1        ESC[1g          Clr vertical tabs       *
  275.  aTBC4        ESC[4g          Clr all v tabs          *
  276.  aTBCALL      ESC#4           Clr all h & v tabs      *
  277.  aTBSALL      ESC#5           Set default tabs (every 8)
  278.  
  279.  aEXTEND      ESC[Pn"x        Extended commands
  280.                               This is a mechanism for printer drivers to
  281.                               support extra commands which can be called
  282.                               by ANSI control sequences
  283.  aRAW         ESC[Pn"r        Next 'Pn' chars are raw (ie. they are not
  284.                               parsed by the printer device, instead they
  285.                               are sent directly to the printer.
  286.  
  287.  
  288.  (*) indicates that sending this command may cause unexpected results
  289.      on a large number of printers.
  290. printer.device/PBothReady                           printer.device/PBothReady
  291.  
  292.    NAME
  293.     PBothReady - wait until output is finished
  294.  
  295.    FUNCTION
  296.     The function PBothReady should only be called from drivers. It waits
  297.     until the output to the printer is finished.
  298. printer.device/PRD_DUMPRPORT                     printer.device/PRD_DUMPRPORT
  299.  
  300.    NAME
  301.     PRD_DUMPRPORT -- dump the specified RastPort to a graphics printer
  302.  
  303.    FUNCTION
  304.     Print a rendition of the supplied RastPort, using the supplied
  305.     ColorMap, position and scaling information, as specified in
  306.     the printer preferences.
  307.  
  308.    IO REQUEST
  309.     io_Message    mn_ReplyPort set if quick I/O is not possible.
  310.     io_Command    PRD_DUMPRPORT.
  311.     io_Flags    IOB_QUICK set if quick I/O is possible.
  312.     io_RastPort    ptr to a RastPort.
  313.     io_ColorMap    ptr to a ColorMap.
  314.     io_Modes    the 'modes' flag from a ViewPort structure,
  315.             (the upper word is reserved and should be zero).
  316.  
  317.             If you are running under version 36, or greater
  318.             of graphics.library, it is recommended that
  319.             you fill in "io_Modes" with the ULONG (32-bit)
  320.             value returned from calling:
  321.  
  322.             ULONG ModeID = GetVPModeID(struct ViewPort *);
  323.  
  324.             Doing so provides for upwards compatability with
  325.             the new display modes available under V36
  326.             (example: aspect ratio calculations for new
  327.             display modes).
  328.  
  329.     io_SrcX        x offset into the RastPort to start printing from.
  330.     io_SrcY        y offset into the RastPort to start printing from.
  331.     io_SrcWidth    width of the RastPort to print (from io_SrcX).
  332.     io_SrcHeight    height of the RastPort to print (from io_SrcY).
  333.     io_DestCols    width of the printout in printer pixels.
  334.     io_DestRows    height of the printout in printer pixels.
  335.     io_Special    flag bits
  336.             (some of which pertain to DestCols and DestRows).
  337.             -if SPECIAL_MIL is set, then the associated
  338.              parameter is specified in thousandths of
  339.              an inch on the printer.  ie. if DestCols = 8000,
  340.              DestRows = 10500 and SPECIAL_MILROWS and
  341.              SPECIAL_MILCOLS is set then the printout would be
  342.              8.000 x 10.500 inches.
  343.             -if SPECIAL_FULL is set, then the specific dimension
  344.              is set to the maximum possible as determined
  345.              by the printer limits or the configuration
  346.              limits; whichever is less.
  347.             -if SPECIAL_FRAC is set, the parameter is
  348.              taken to be a longword binary fraction
  349.              of the maximum for that dimension.
  350.             -if all bits for a dimension are clear,
  351.              (ie. SPECIAL MIL/FULL/FRAC and ASPECT are NOT set)
  352.              then the parameter is specified in printer pixels.
  353.             -if SPECIAL_CENTER is set then the image will be
  354.              put between the left and right edge of the paper.
  355.             -if SPECIAL_ASPECT is set, one of the dimensions
  356.              may be reduced/expanded to preserve the aspect
  357.              ratio of the print.
  358.             -SPECIAL_DENSITY(1-7) this allows for a maximum of 7
  359.              different print densities.  DENSITY1 is the lowest
  360.              density and the default.
  361.             -SPECIAL_NOFORMFEED - this allows for the mixing of
  362.              text and graphics or multiple graphic dumps on page
  363.              oriented printers (usually laser jet printers).
  364.              When this flag is set the page will not be ejected
  365.              after a graphic dump.  If you perform another
  366.              graphic dump without this flag set OR close the
  367.              printer after printing text after a graphic dump,
  368.              the page will be ejected.
  369.             -if SPECIAL_TRUSTME is set then the printer specific
  370.              driver is instructed to not issue a reset command
  371.              before and after the dump.  If this flag is NOT
  372.              checked by the printer specific driver then setting
  373.              this flag has no effect.  Since we now recommend
  374.              that printer driver writers no longer issue a reset
  375.              command it is probably a safe idea to always set
  376.              this flag when calling for a dump.
  377.             -if SPECIAL_NOPRINT is set then the following is done:
  378.              Compute print size, set 'io_DestCols' and
  379.              'io_DestRows' in the calling program's 'IODRPReq'
  380.              structure and exit, DON'T PRINT.  This allows the
  381.              calling program to see what the final print size
  382.              would be in printer pixels.  Note that it modifies
  383.              the 'io_DestCols' and 'io_DestRows' fields of your
  384.              'IODRPReq' structure.  It also sets the print
  385.              density and updates the 'MaxXDots', 'MaxYDots',
  386.              'XDotsInch', and 'YDotsInch' fields of the
  387.              'PrinterExtendedData' structure.
  388.  
  389.     There following rules for the interpretation of io_DestRows and
  390.     io_DestCols that may produce unexpected results when they are
  391.     not greater than zero and io_Special is zero.  They have been
  392.     retained for compatability.  The user will not trigger these
  393.     other rules with well formed usage of io_Special.
  394.  
  395.     When io_Special is equal to 0, the following rules
  396.     (from the V1.1 printer.device, and retained for compatibility
  397.     reasons) take effect.  Remember, these special rules are
  398.     for io_DestRows and io_DestCols and only take effect
  399.     if io_Special is 0).
  400.  
  401.     a) DestCols>0 & DestRows>0 - use as absolute values.
  402.        ie. DestCols=320 & DestRows=200 means that the picture
  403.        will appear on the printer as 320x200 dots.
  404.     b) DestCols=0 & DestRows>0 - use the printers maximum number
  405.        of columns and print DestRows lines. ie. if DestCols=0
  406.        and DestRows=200 than the picture will appear on the
  407.        printer as wide as it can be and 200 dots high.
  408.     c) DestCols=0 & DestRows=0 - same as above except the driver
  409.        determines the proper number of lines to print based on
  410.        the aspect ratio of the printer. ie. This results in the
  411.        largest picture possible that is not distorted or inverted.
  412.        Note: As of this writing, this is the call made by such
  413.        program as DeluxePaint, GraphicCraft, and AegisImages.
  414.     d) DestCols>0 &DestRows=0 - use the specified width and the
  415.        driver determines the proper number of lines to print based
  416.        on the aspect ratio of the printer. ie. if you desire a
  417.        picture that is 500 pixels wide and aspect ratio correct,
  418.        use DestCols=500 and DestRows=0.
  419.     e) DestCols<0 or DestRows>0 - the final picture is either a
  420.        reduction or expansion based on the fraction
  421.        |DestCols| / DestRows in the proper aspect ratio.
  422.        Some examples:
  423.        1) if DestCols=-2 & DestRows=1 then the printed picture will
  424.           be 2x the AMIGA picture and in the proper aspect ratio.
  425.           (2x is derived from |-2| / 1 which gives 2.0)
  426.        2) if DestCols=-1 & DestRows=2 then the printed picture will
  427.           will be 1/2x the AMIGA picture in the proper aspect ratio.
  428.           (1/2x is derived from |-1| / 2 which gives 0.5)
  429.  
  430.    NOTES
  431.     The printer selected in preferences must have graphics
  432.     capability to use this command.  The error 'PDERR_NOTGRAPHICS'
  433.      is returned if the printer can not print graphics.
  434.  
  435.     Color printers may not be able to print black and white or
  436.     greyscale pictures -- specifically, the Okimate 20 cannot print
  437.     these with a color ribbon: you must use a black ribbon instead.
  438.     If the printer has an input buffer option, use it.
  439.     If the printer can be uni or bi directional, select
  440.     uni-directional; this produces a much cleaner picture.
  441.     Most printer drivers will attempt to set unidirectional
  442.     printing if it is possible under software control.
  443.  
  444.     Please note that the width and height of the printable area on
  445.     the printer is in terms of pixels and bounded by the following:
  446.      a) WIDTH = (RIGHT_MARGIN - LEFT_MARGIN + 1) / CHARACTERS_PER_INCH
  447.      b) HEIGHT = LENGTH / LINES_PER_INCH
  448.     Margins are set by preferences.
  449.  
  450.     For BGR printer support, the YMC values in the printer
  451.     specific render.c functions equate to BGR respectively, ie.
  452.     yellow is blue, magenta is green, and cyan is red.
  453.  
  454.     For version 2.1 of the Operating System (the Localization
  455.     release), some of the printer drivers have been modified to
  456.     support European A size paper (e.g., "A4").  See preferences.h
  457.     for a list of defined sizes.  For most printers, this means
  458.     the maximum X dots will be calculated based on millimeters
  459.     minus 1/2 inch (approx 13 mm) - this is consistent with existing
  460.     driver calculations (e.g., 8.0 inches wide for US_LETTER, and
  461.     US_LEGAL sizes).
  462.  
  463.     Some printers, like the HP_LaserJet, and HP_DeskJet also
  464.     calculate maximum Y dots.
  465.  
  466.     For all modified printer drivers, selecting paper sizes larger
  467.     than the printer can handle may result in unexpected, or
  468.     clipped results.  This allows for the possibility of using
  469.     these drivers with future printers which may physically
  470.     [and internally] support these larger sizes of paper.
  471.  
  472.     It is assumed that the user will make reasonable choices when
  473.     selecting paper size (e.g., not select WIDE TRACTOR for a
  474.     NARROW TRACTOR printer).
  475.  
  476.  Data Structures
  477.  ---------------
  478.  
  479.     The printer specific and non-specific data structures can be read
  480.     ONCE you have opened the printer device.  Here is a code fragment
  481.     to illustrate how to do just that.
  482.  
  483.     #include <exec/types.h>
  484.     #include <devices/printer.h>
  485.     #include <devices/prtbase.h>
  486.     #include <devices/prtgfx.h>
  487.  
  488.     struct IODRPReq PReq;
  489.     struct PrinterData *PD;
  490.     struct PrinterExtendedData *PED;
  491.  
  492.    open the printer device / if it opened...
  493.    if (OpenDevice("printer.device", 0, &PReq, 0) == NULL) {
  494.        get pointer to printer data
  495.        PD = (struct PrinterData *)PReq.io_Device;
  496.        get pointer to printer extended data
  497.        PED = &PD->pd_SegmentData->ps_PED;
  498.        let's see what's there
  499.        printf("PrinterName = '%s', Version=%u, Revision=%u\n",
  500.            PED->ped_PrinterName, PD->pd_SegmentData->ps_Version,
  501.            PD->pd_SegmentData->ps_Revision,);
  502.        printf("PrinterClass=%u, ColorClass=%u\n",
  503.            PED->ped_PrinterClass, PED->ped_ColorClass);
  504.        printf("MaxColumns=%u, NumCharSets=%u, NumRows=%u\n",
  505.            PED->ped_MaxColumns, PED->ped_NumCharSets, PED->ped_NumRows);
  506.        printf("MaxXDots=%lu, MaxYDots=%lu, XDotsInch=%u, YDotsInch=%u\n",
  507.            PED->ped_MaxXDots, PED->ped_MaxYDots,
  508.            PED->ped_XDotsInch, PED->ped_YDotsInch);
  509.        CloseDevice(&PReq);
  510.    }
  511.  
  512.  Preferences
  513.  -----------
  514.  
  515.     If you want the user to be able to access the printer preferences items
  516.  without having to run preferences (like DPAINT II's printer requester),
  517.  here is what you do.  You can look at the printer's copy of preferences
  518.  by referring to 'PD->pd_Preferences' (the printer device MUST already be
  519.  opened at this point).  After you have this you could put up a requester
  520.  and allow the user to change whatever parameters they wanted.
  521.  BEAR IN MIND THAT YOU ARE RESPONSIBLE FOR RANGE CHECKING THESE SELECTIONS!
  522.  Listed below are the printer preferences items and their valid values.
  523.  
  524.  PrintPitch         - PICA, ELITE, FINE.
  525.  PrintQuality       - DRAFT, LETTER.
  526.  PrintSpacing       - SIX_LPI, EIGHT_LPI.
  527.  PrintLeftMargin    - 1 to PrintRightMargin.
  528.  PrintRightMargin   - PrintLeftMargin to 999.
  529.  PaperLength        - 1 to 999.
  530.  PrintImage         - IMAGE_POSITIVE, IMAGE_NEGATIVE.
  531.  PrintAspect        - ASPECT_HORIZ, ASPECT_VERT.
  532.  PrintShade         - SHADE_BW, SHADE_GREYSCALE, SHADE_COLOR.
  533.  PrintThreshold     - 1 to 15.
  534.  PrintFlags         - CORRECT_RED, CORRECT_GREEN, CORRECT_BLUE, CENTER_IMAGE,
  535.                       IGNORE_DIMENSIONS, BOUNDED_DIMENSIONS,
  536.                       ABSOLUTE_DIMENSIONS, PIXEL_DIMENSIONS,
  537.                       MULTIPLY_DIMENSIONS, INTEGER_SCALING,
  538.                       ORDERED_DITHERING, HALFTONE_DITHERING.
  539.                       FLOYD_DITHERING, ANTI_ALIAS, GREY_SCALE2
  540.  PrintMaxWidth      - 0 to 65535.
  541.  PrintMaxHeight     - 0 to 65535.
  542.  PrintDensity       - 1 to 7.
  543.  PrintXOffset       - 0 to 255.
  544.  
  545.  Asynchronous I/O
  546.  ----------------
  547.  
  548.      The recommended way to do asynchronous i/o is...
  549.  
  550.  a) To send requests for i/o.
  551.  
  552.      struct IORequest *ioreq;
  553.      struct MsgPort *port;
  554.      UBYTE signal;
  555.  
  556.      port = ioreq->io_Message.mn_ReplyPort;
  557.      signal = port->mp_SigBit;
  558.  
  559.      SendIO(ioreq);  send request
  560.      Wait(signal);  wait for completion (go to sleep)
  561.      while ((Msg = GetMsg(port)) != NULL) {  get ALL messages
  562.      }
  563.  
  564.  b) To abort a previous request for i/o.
  565.  
  566.      struct IORequest *ioreq;
  567.  
  568.      AbortIO(ioreq);  abort request
  569.      WaitIO(ioreq);  wait for reply
  570.  
  571.      at this point you can re-use 'ioreq'.
  572.  
  573.      Note that in the above examples 'ioreq' could be any one of...
  574.      a) struct IOStdReq    a standard i/o request
  575.      b) struct IODRPReq    a dumprport i/o request
  576.      c) struct IOPrtCmdReq a printer command i/o request
  577.  
  578.      It is recommend that you do asynchronous i/o in your programs
  579.      and give the user a way of aborting all requests.
  580.  
  581.  
  582.          V1.3 Printer Driver Notes
  583.          -------------------------
  584.  
  585.      In general densities which use more than one pass should only be
  586.  used for B&W shade dumps.  They can be used for Grey-Scale or Color Shade
  587.  dumps BUT the output may tend to look muddy or dark.  Also multiple pass
  588.  Color dumps tend to dirty or smear the ribbon (ie. yellow will get
  589.  contaminated with the other colors on the ribbon; you have been warned).
  590.  
  591.  
  592.  Alphacom_AlphaPro_101
  593.  ---------------------
  594.  1. Daisywheel printer (text only).
  595.  
  596.  Brother_HR-15XL
  597.  ---------------
  598.  1. Daisywheel printer (text only).
  599.  
  600.  CalComp_ColorMaster
  601.  -------------------
  602.  1. Thermal transfer b&w/color printer (text and graphics).
  603.  2. Use Black ribbon for non-color dumps; Color ribbon for color dumps.
  604.  3. Linefeeds # of vertical dots printed.
  605.  4. Densities supported are 203x200(1) dpi.
  606.  5. This is a dual printer driver.  Select a PaperSize of 'Narrow Tractor'
  607.     for use with the ColorMaster; 'Wide Tractor' for use with the
  608.     ColorView-5912 (which uses 11 x 17 inch paper).
  609.  
  610.  CalComp_ColorMaster2
  611.  -------------------
  612.  1. Thermal transfer b&w/color printer (text and graphics).
  613.  2. Use Black ribbon for non-color dumps; Color ribbon for color dumps.
  614.  3. Linefeeds # of vertical dots printed.
  615.  4. Densities supported are 203x200(1) dpi.
  616.  5. This is a dual printer driver.  Select a PaperSize of 'Narrow Tractor'
  617.     for use with the ColorMaster; 'Wide Tractor' for use with the
  618.     ColorView-5912 (which uses 11 x 17 inch paper).
  619.  6. This driver is the same as the Calcomp_ColorMaster driver EXCEPT it is
  620.     approximately 2 times faster (during color dumps) and requires LOTS of
  621.     memory (up to 1,272,003 bytes for a full 8 x 10 inch (1600 x 2000 dot)
  622.     color dump).  Typically full-size (color) dumps are 1600 x 1149 dots and
  623.     require 730,767 bytes.  Memory requirements for the ColorView-5912
  624.     are up to 2,572,803 bytes for a full 10 x 16 inch (2048 x 3200 dot)
  625.     color dump.  Typically full-size (color) dumps are 2048 x 2155 dots and
  626.     require 1,732,623 bytes.  The memory requirements are 1/3 when doing a
  627.     non-color printout (on both the ColorMaster and ColorView).
  628.  
  629.  Canon_PJ-1080A
  630.  --------------
  631.  1. Ink jet b&w/color printer (text and graphics).
  632.  2. Linefeeds # of vertical dots printed.
  633.  3. Densities supported are 83x84(1) dpi.
  634.  
  635.  CBM_MPS1000
  636.  -----------
  637.  1. Dot matrix b&w printer (text and graphics).
  638.  2. Linefeeds # of vertical dots printed (-1/3 dot if PaperType = Single). *2
  639.  3. Density    XDPI    YDPI    XYDPI    Comments
  640.      1    120     72     8640
  641.      2    120    144    17280    two pass
  642.      3    240     72    17280            *1
  643.      4    120    216    25920    three pass
  644.      5    240    144    34560    two pass    *1
  645.      6    240    216    51840    three pass    *1
  646.      7    same as 6
  647.  4. Print width for US_LETTER size paper is 8.0 inches.
  648.  5. As of version 35.48, this driver calculates maximum X dots for
  649.     European A size paper as defined in preferences.h.  Some of
  650.     these sizes are too large for this printer.
  651.  
  652.  Diablo_630
  653.  ----------
  654.  1. Daisywheel printer (text only).
  655.  
  656.  Diablo_Advantage_D25
  657.  --------------------
  658.  1. Daisywheel printer (text only).
  659.  
  660.  Diablo_C-150
  661.  ------------
  662.  1. Ink jet b&w/color printer (text and graphics).
  663.  2. Always linefeeds 4 dots (limitation of printer).
  664.  3. A PaperSize of 'Wide Tractor' selects a maximum print width of
  665.     8.5 inches (for wide roll paper).
  666.  5. Densities supported are 120x120(1) dpi.
  667.  
  668.  EpsonQ (24-pin Epson compatible)
  669.  ------
  670.  1. Dot matrix b&w/color printer (text and graphics).
  671.  2. Drives all EpsonQ (LQ1500, LQ2500, etc.) compatible printers.
  672.  3. Linefeeds # of vertical dots printed.
  673.  4. Density    XDPI    YDPI    XYDPI    Comments
  674.      1     90    180    16200
  675.      2    120    180    21600
  676.      3    180    180    32400
  677.      4    360    180    64800    *1
  678.      5,6,7    same as 4
  679.  5. A PaperSize of 'Wide Tractor' selects a maximum print width of
  680.     13.6 inches (for wide carriage printers).
  681.  6. A PaperType of 'Single' uses only 16 of the 24 pins, whereas a PaperType
  682.     of 'Fanfold' uses all 24 pins.  The 'Single' option is useful for those
  683.     printers which have a weak power supply and cannot drive all 24 pins
  684.     continuously.  If during a single pass of the print head you notice that
  685.     the top two thirds of the graphics are darker than the bottom one third
  686.     then you will probably need to drop down to 16 pins.
  687.  7. As of version 35.71, this driver calculates maximum X dots for
  688.     European A size paper as defined in preferences.h.  The calculation
  689.     is based on millimeters minus 1/2 inch (approx 13mm).  Maximum
  690.     paper width is 13.6 inches, so some European A sizes are too large
  691.     for this printer.
  692.  
  693.  EpsonX[CBM_MPS-1250] (8/9-pin Epson compatible)
  694.  --------------------
  695.  1. Dot matrix b&w/color printer (text and graphics).
  696.  2. Drives all EpsonX (EX/FX/JX/LX/MX/RX, etc.) compatible printers.
  697.  3. Linefeeds # of vertical dots printed (-1/3 dot if PaperType = Single). *2
  698.  4. Density    XDPI    YDPI    XYDPI    Comments
  699.      1    120     72     8640
  700.      2    120    144    17280    two pass
  701.      3    240     72    17280            *1
  702.      4    120    216    25920    three pass
  703.      5    240    144    34560    two pass    *1
  704.      6    240    216    51840    three pass    *1
  705.      7    same as 6
  706.  
  707.  5. A PaperSize of 'Wide Tractor' selects a maximum print width of
  708.     13.6 inches (for wide carriage printers).
  709.  6. Use this driver if you own a CBM_MPS-1250 (as it is EpsonX compatible).
  710.  7. As of version 35.42, this driver calculates maximum X dots for
  711.     European A size paper as defined in preferences.h.  The calculation
  712.     is based on millimeters minus 1/2 inch (approx 13mm).  Maximum
  713.     paper width is 13.6 inches, so some European A sizes are too large
  714.     for this printer.
  715.  
  716.  EpsonXOld (8/9-pin Epson compatible)
  717.  ---------
  718.  1. Dot matrix b&w printer (text and graphics).
  719.  2. Drives all very old EpsonX (EX/FX/JX/LX/MX/RX, etc.) compatible printers.
  720.  3. Linefeeds # of vertical dots printed.
  721.  4. Density    XDPI    YDPI    XYDPI    Comments
  722.      1     60    72     4320
  723.      2    120    72     8640    (double speed)            *1
  724.      3    120    72     8640
  725.      4    240    72    17280                    *1
  726.      5    120    72     8640    (for use on old Star printers)
  727.      6    240    72    17280    (for use on old Star printers)    *1
  728.      7    240    72    17280    (same as density 4)        *1
  729.  5. A PaperSize of 'Wide Tractor' selects a maximum print width of
  730.     13.6 inches (for wide carriage printers).
  731.  6. Use this driver if the EpsonX driver does not work properly in graphics
  732.     or text mode on your EpsonX compatible printer.
  733.  
  734.  generic
  735.  -------
  736.  1. Text only printer.
  737.  
  738.  Howtek_Pixelmaster
  739.  ------------------
  740.  1. Plastic ink jet b&w/color printer (text and graphics).
  741.  2. Linefeeds # of vertical dots printed.
  742.  3. Density    XDPI    YDPI    XYDPI    Comments
  743.      1     80     80     6400
  744.      2    120    120    14400
  745.      3    160    160    25600
  746.      4    240    240    57600
  747.      5,6,7    same as 4
  748.  4. Maximum print area is 8.0 x 10.0 inches.
  749.  
  750.  HP_DeskJet
  751.  ----------
  752.  1. Ink jet non-color printer (text and graphics).
  753.  2. Linefeeds # of vertical dots printed.
  754.  3. Density    XDPI    YDPI    XYDPI    Comments
  755.      1     75     75     5625
  756.      2    100    100    10000
  757.      3    150    150    22500
  758.      4    300    300    90000
  759.      5,6,7    same as 4
  760.  4. Maximum print area is 8.0 x 10.0 inches US_LEGAL, and 8.0 x
  761.     13.0 inches US_LETTER.
  762.  5. As of version 35.29, the driver will calculate maximum area
  763.     size for European A size paper as defined in preferences.h.
  764.     The driver calculates the maximum X, and Y dots based on
  765.     millimeters, minus 1/2 inch from the width, and minus 1"
  766.     from the height (approx 13mm, and 26mm respectively).
  767.     Therefore the margin area is consistent with US paper sizes.
  768.  6. Some European A sizes are too large for this printer.
  769.  
  770.  HP_LaserJet (LaserJet+/LaserJetII compatible)
  771.  -----------
  772.  1. Laser engine non-color printer (text and graphics).
  773.  2. Linefeeds # of vertical dots printed.
  774.  3. Density    XDPI    YDPI    XYDPI    Comments
  775.      1     75     75     5625
  776.      2    100    100    10000
  777.      3    150    150    22500
  778.      4    300    300    90000
  779.      5,6,7    same as 4
  780.  4. Maximum print area is 8.0 x 10.0 inches US_LEGAL, and 8.0 x
  781.     13.0 inches US_LETTER.
  782.  5. As of version 35.59, the driver will calculate maximum area
  783.     size for European A size paper as defined in preferences.h.
  784.     The driver calculates the maximum X, and Y dots based on
  785.     millimeters, minus 1/2 inch from the width, and minus 1"
  786.     from the height (approx 13 mm, and 26 mm respectively).
  787.     Therefore the margin area is consistent with US paper sizes.
  788.  6. Some European A sizes are too large for this printer.
  789.  
  790.  HP_PaintJet
  791.  -----------
  792.  1. Ink jet b&w/color printer (text and graphics).
  793.  2. Linefeeds # of vertical dots printed.
  794.  3. Densities supported are 180x180(1) dpi.
  795.  
  796.  HP_ThinkJet
  797.  ----------
  798.  1. Ink jet non-color printer (text and graphics).
  799.  2. Linefeeds # of vertical dots printed.
  800.  3. Density    XDPI    YDPI    XYDPI    Comments
  801.      1     96    96     9216
  802.      2    192    96    18432
  803.      3,4,5,6,7    same as 4
  804.  4. This printer prints 640 dots X in 96 DPI mode, and 120 dots
  805.     X in 192 DPI mode.  Other sizes are not supported by the
  806.     printer.
  807.  
  808.  Imagewriter II (Imagewriter compatible)
  809.  --------------
  810.  1. Dot matrix b&w/color printer (text and graphics).
  811.  2. Linefeeds # of vertical dots printed.
  812.  3. Density    XDPI    YDPI    XYDPI    Comments
  813.      1     80     72     5760
  814.      2    120     72     8640
  815.      3    144     72    10368
  816.      4    160     72    11520
  817.      5    120    144    17280    two pass
  818.      6    144    144    20736    two pass
  819.      7    160    144    23040    two pass
  820.  
  821.  Nec_Pinwriter (24-wire Pinwriter compatible (P5/P6/P7/P9/P2200))
  822.  -------------
  823.  1. Dot matrix b&w/color printer (text and graphics).
  824.  2. Drives all NEC 24-wire Pinwriter compatible printers.
  825.  3. Linefeeds # of vertical dots printed.
  826.  4. Density    XDPI    YDPI    XYDPI    Comments
  827.      1     90    180     16200
  828.      2    120    180     21600
  829.      3    180    180     32400
  830.      4    120    360     43200    two pass
  831.      5    180    360     64800    two pass
  832.      6    360    180     64800
  833.      7    360    360    129600    two pass
  834.  5. A PaperSize of 'Wide Tractor' selects a maximum print width of
  835.     13.6 inches (for wide carriage printers).
  836.  6. As of version 35.17, this driver calculates maximum X dots for
  837.     European A size paper as defined in preferences.h.  The calculation
  838.     is based on millimeters minus 1/2 inch (approx 13mm).  Maximum
  839.     paper width is 13.6 inches, so some European A sizes are too large
  840.     for this printer.
  841.  
  842.  Okidata_92
  843.  ----------
  844.  1. Dot matrix non-color printer (text and graphics).
  845.  2. Always linefeeds 7/72 inch (limitation of printer in graphics mode).
  846.  3. Densities supported are 72x72 dpi.
  847.  
  848.  Okidata_293I
  849.  ------------
  850.  1. Dot matrix b&w/color printer (text and graphics).
  851.  2. Drives 292 or 293 using the IBM interface module.
  852.  3. Linefeeds # of vertical dots printed (-1/2 dot if PaperType = Single) *3
  853.  4. Density    XDPI    YDPI    XYDPI    Comments
  854.      1    120    144    17280
  855.      2    240    144    34560
  856.      3    120    288    34560    two pass
  857.      4    240    288    69120    two pass
  858.      5,6,7    same as 4
  859.  5. A PaperSize of 'Wide Tractor' selects a maximum print width of
  860.     13.6 inches (for wide carriage printers).
  861.  
  862.  Okimate-20
  863.  ----------
  864.  1. Thermal transfer b&w/color printer (text and graphics).
  865.  2. Use Black ribbon for non-color dumps; Color ribbon for color dumps.
  866.  3. Linefeeds an even # of dots printed. (ie. if 3 printed, 4 advanced).
  867.  4. Densities supported are 120x144(1) dpi.
  868.  
  869.  Quadram_QuadJet
  870.  ---------------
  871.  1. Ink jet b&w/color printer (text and graphics).
  872.  2. Linefeeds # of vertical dots printed.
  873.  3. Densities supported are 83x84(1) dpi.
  874.  
  875.  Qume_LetterPro_20
  876.  -----------------
  877.  1. Daisywheel printer (text only).
  878.  
  879.  Seiko_5300
  880.  ----------
  881.  1. Thermal transfer b&w/color printer (graphics only).
  882.  2. Use Black ribbon for non-color dumps; Color ribbon for color dumps.
  883.  3. Density    XDPI    YDPI    XYDPI    Comments
  884.      1    152    152    23104    drives CH-5301 printer
  885.      2    203    203    41209    drives CH-5312 printer
  886.      3    240    240    57600    drives CH-5303 printer
  887.      4, 5,6,7    same as 3
  888.      You must select the proper density to drive the specific printer
  889.      that you have.
  890.  4. This driver is not on the V1.3 Workbench or Extras disk.  It is
  891.     available on BIX and directly from Seiko.
  892.  
  893.  Seiko_5300a
  894.  -----------
  895.  1. Thermal transfer b&w/color printer (graphics only).
  896.  2. Use Black ribbon for non-color dumps; Color ribbon for color dumps.
  897.  3. Density    XDPI    YDPI    XYDPI    Comments
  898.      1    152    152    23104    drives CH-5301 printer
  899.      2    203    203    41209    drives CH-5312 printer
  900.      3    240    240    57600    drives CH-5303 printer
  901.      4, 5,6,7    same as 3
  902.      You must select the proper density to drive the specific printer
  903.      that you have.
  904.  4. This driver is the same as the Seiko_5300 driver EXCEPT it is
  905.     approximately 2 times faster (during color dumps) and requires LOTS of
  906.     memory (up to 1,564,569 bytes for a full 8 x 10 inch (1927 x 2173 dot)
  907.     color dump).  Typically full-size (color) dumps are 1927 x 1248 dots
  908.     and require 898,569 bytes.  The memory requirements are 1/3 when doing
  909.     a non-color printout.
  910.  5. This driver is not on the V1.3 Workbench or Extras disk.  It is
  911.     available on BIX and directly from Seiko.
  912.  
  913.  Tektronix_4693D
  914.  ---------------
  915.  1. Thermal transfer b&w/color printer (graphics only).
  916.  2. Densities supported are 300x300(1) dpi
  917.  3. Due to the way the printer images a picture none of the printer
  918.     preferences options affect the printout with the following exceptions:
  919.     a)Aspect - Horizontal, Vertical
  920.     b)Shade - B&W, Grey_Scale, Color
  921.     ...as a result of this only full size pictures can be printed.
  922.  4. Keypad menu option 3b COLOR ADJUSTMENT may be set from the keypad.
  923.     For normal prints this option should be set to "do not adjust".
  924.  5. Keypad menu option 3d VIDEO COLOR CORRECTION may be set from the keypad.
  925.     For normal prints this option should be set to "do not adjust".
  926.  6. Keypad menu option 5 BACKGROUND COLOR EXCHANGE may be set from the
  927.     keypad.  For normal prints this option should be set to "print colors
  928.     as received".
  929.  7. Once a picture has been printed additional copies may be printed
  930.     without resending by using the printers keypad.
  931.  8. This driver is not on the V1.3 Workbench or Extras disk.  It is
  932.     available on BIX and directly from Tektronix.
  933.  
  934.  Tektronix_4696
  935.  --------------
  936.  1. Ink jet b&w/color printer (text and graphics).
  937.  2. Always linefeeds 4 dots (limitation of printer).
  938.  3. Densities supported are 121x120(1), 242x120(black)(2) and
  939.     242x120(color)(3).
  940.     Selecting a density of 2 or higher really doesn't give you true 242 dpi
  941.     resolution since the printer only has 121 x dots per inch.
  942.     Instead this mode tells the printer to go into it's double pass mode.
  943.     Here, it outputs a line of dots at 121 dpi; and outputs the line again
  944.     (shifted to the right by 1/242 of an inch).  This produces much more
  945.     vibrate colors and gives the illusion of more resolution.  One drawback
  946.     is that large areas of solid colors (red, green, and blue specifically)
  947.     tend to over-saturate the paper with ink.  Density1 outputs all colors
  948.     in one pass.  Density 2 does a double pass on black.  Density 3 does a
  949.     double pass on all colors.  Density 1 to 3 correspond to the printer's
  950.     graphics printing modes 1 to 3 (respectively).
  951.  4. This driver is not on the V1.3 Workbench or Extras disk.  It is
  952.     available on BIX and directly from Tektronix.
  953.  5. A PaperSize of 'Wide Tractor' selects a maximum print width of
  954.     9.0 inches (for wide roll paper).
  955.  
  956.  Toshiba_P351C (24-pin Toshiba compatible)
  957.  -------------
  958.  1. Dot matrix b&w/color printer (text and graphics).
  959.  2. Drives all Toshiba_P351C compatible printers.
  960.  3. Linefeeds # of vertical dots printed.
  961.  4. Density    XDPI    YDPI    XYDPI    Comments
  962.      1    180    180    32400
  963.      2    360    180    64800
  964.      3,4,5,6,7    same as 2
  965.  5. A PaperSize of 'Wide Tractor' selects a maximum print width of
  966.     13.5 inches (for wide carriage printers).
  967.  
  968.  Toshiba_P351SX (24-pin Toshiba compatible)
  969.  --------------
  970.  1. Dot matrix b&w/color printer (text and graphics).
  971.  2. Drives all Toshiba_P351SX (321SL, 321SLC, 341SL) compatible printers.
  972.  3. Linefeeds # of vertical dots printed.
  973.  4. Density    XDPI    YDPI    XYDPI    Comments
  974.      1    180    180     32400
  975.      2    360    180     64800
  976.      3    180    360     64800    two pass
  977.      4    360    360    129600    two pass
  978.      5,6,7    same as 4
  979.  5. A PaperSize of 'Wide Tractor' selects a maximum print width of
  980.     13.5 inches (for wide carriage printers).
  981.  
  982.  Xerox_4020
  983.  ----------
  984.  1. Ink jet b&w/color printer (text and graphics).
  985.  2. Always linefeeds 4 dots (limitation of printer).
  986.  3. This driver is IDENTICAL to the Diablo_C-150 driver EXCEPT it outputs
  987.     all black dots TWICE.  This is a special feature of this printer and
  988.     produces much more solid, darker black shades.  Please note that some
  989.     printing time overhead results from this feature; if you don't want it
  990.     use the Diablo_C-150 driver.
  991.  4. Densities supported are 121x120(1) and 242x240(2) dpi.
  992.     Selecting a density of 2 or higher really doesn't give you true 240 dpi
  993.     resolution since the Xerox_4020 only has 121 x dots per inch.
  994.     Instead this mode tells the printer to go into it's pseudo 240 dpi mode.
  995.     Here, it outputs a line of dots at 121 dpi; moves the paper up 1/240 of
  996.     an inch and outputs the line again (shifted to the right by 1/240 of an
  997.     inch).  This produces much more vibrate colors and gives the illusion
  998.     of more resolution.  One drawback is that large areas of solid colors
  999.     (red, green, and blue specifically) tend to over-saturate the paper with
  1000.     ink.
  1001.  5. A PaperSize of 'Wide Tractor' selects a maximum print width of
  1002.     9.0 inches (for wide roll paper).
  1003.  
  1004.  
  1005.  Notes
  1006.  -----
  1007.  
  1008.  *0 - on most printers friction fed paper tends to produce better looking
  1009.       (ie. less horizontal banding) graphic dumps than tractor fed paper.
  1010.  
  1011.  *1 - in this mode the printer cannot print two consecutive dots in a row.
  1012.       It is recommended that you only use this density for B&W Shade dumps.
  1013.  
  1014.  *2 - only when 72 YDPI is selected.  This option is useful if you notice
  1015.       tiny white horizontal strips in your printout.
  1016.  
  1017.  *3 - only when 144 YDPI is selected.  This option is useful if you notice
  1018.       tiny white horizontal strips in your printout.
  1019. printer.device/PRD_DUMPRPORTTAGS             printer.device/PRD_DUMPRPORTTAGS
  1020.  
  1021.    NAME
  1022.     PRD_DUMPRPORTTAGS -- dump the specified RastPort to a printer (V44)
  1023.  
  1024.    FUNCTION
  1025.     Print a rendition of the supplied RastPort, using the supplied
  1026.     ColorMap, position and scaling information, as specified in
  1027.     the printer preferences.
  1028.  
  1029.    IO REQUEST
  1030.     io_Message    mn_ReplyPort set if quick I/O is not possible.
  1031.     io_Command    PRD_DUMPRPORT.
  1032.     io_Flags    IOB_QUICK set if quick I/O is possible.
  1033.     io_RastPort    ptr to a RastPort.
  1034.     io_ColorMap    ptr to a ColorMap.
  1035.     io_Modes    the 'modes' flag from a ViewPort structure,
  1036.             (the upper word is reserved and should be zero).
  1037.  
  1038.             If you are running under version 36, or greater
  1039.             of graphics.library, it is recommended that
  1040.             you fill in "io_Modes" with the ULONG (32-bit)
  1041.             value returned from calling:
  1042.  
  1043.             ULONG ModeID = GetVPModeID(struct ViewPort *);
  1044.  
  1045.             Doing so provides for upwards compatability with
  1046.             the new display modes available under V36
  1047.             (example: aspect ratio calculations for new
  1048.             display modes).
  1049.  
  1050.     io_SrcX        x offset into the RastPort to start printing from.
  1051.     io_SrcY        y offset into the RastPort to start printing from.
  1052.     io_SrcWidth    width of the RastPort to print (from io_SrcX).
  1053.     io_SrcHeight    height of the RastPort to print (from io_SrcY).
  1054.     io_DestCols    width of the printout in printer pixels.
  1055.     io_DestRows    height of the printout in printer pixels.
  1056.     io_Special    flag bits
  1057.     io_TagList    a list of tags to specify more parameters for the 
  1058.             dump.
  1059.  
  1060.    TAGS
  1061.     DRPA_SourceHook    a pointer to struct Hook which is called to read
  1062.             the source data. io_RastPort and io_ColorMap are
  1063.             ignored and should be NULL. 
  1064.  
  1065.             The hook is called with object == NULL and message
  1066.             is a pointer to struct DRPSourceMsg. It must read
  1067.             an array of source data. 
  1068.  
  1069.             Each pixel of the array is an ULONG of form 
  1070.             0x00RRGGBB.
  1071.             
  1072.             Some printer drivers have set PPCB_NOSTRIPE which
  1073.             means they cannot print in stripes. Using
  1074.             DRPA_SourceHook is the best way for printing for such
  1075.             printers because you can still prepare the printer
  1076.             source data in stripes then.
  1077.             
  1078.             The Source Hook is always called in the context of
  1079.             the printer driver DOS process.
  1080.  
  1081.     DRPA_AspectX    the X aspect ratio.
  1082.     DRPA_AspectY    the Y aspect ratio. This values overwrites the
  1083.             aspect ratio from GfxBase or io_Modes and is used
  1084.             for scaling.
  1085. printer.device/PRD_EDITPREFS                     printer.device/PRD_EDITPREFS
  1086.  
  1087.    NAME
  1088.     PRD_EDITPREFS - open the driver preferences window (V44)
  1089.  
  1090.    FUNCTION
  1091.     New drivers can have own preferences. This commands ask the driver
  1092.     to open a window to allow the user to change the prefs. Typically
  1093.     this is done with an DoIO() call.
  1094.     
  1095.     Every application should have a button "Driver Options..." (that
  1096.     calls PRD_EDITPREFS) in its printer dialog.
  1097.  
  1098.    IO REQUEST
  1099.     io_Message    mn_ReplyPort set if quick I/O is not possible.
  1100.     io_Command    PRD_EDITPREFS
  1101.     io_Flags    IOB_QUICK set if quick I/O is possible.
  1102.     io_TagList    a list of tags to specify more parameters
  1103.  
  1104.     The following tags are currently defined:
  1105.     
  1106.     PPRA_Window (struct Window *)    a pointer to a window. This prefs
  1107.         window will open on the same screen and lock the window from
  1108.         user input.
  1109.     PPRA_Screen (struct Screen *)    a pointer to a screen. That can be
  1110.         used if no window is open.
  1111.     PPRA_PubScreen (STRPTR)    a name of a public screen that will be used
  1112.         to open the window. This can be NULL to use the default
  1113.         public screen.
  1114. printer.device/PRD_PRTCOMMAND                   printer.device/PRD_PRTCOMMAND
  1115.  
  1116.    NAME
  1117.        PRD_PRTCOMMAND -- send a command to the printer
  1118.  
  1119.    FUNCTION
  1120.       This function sends a command to either the parallel or serial
  1121.       device.  The printer device maps this command to the control
  1122.       code set of the current printer.  The commands supported can
  1123.       be found with the printer.device/Write command.  All printers
  1124.       may not support all functions.
  1125.  
  1126.    IO REQUEST IOPrtCmdReq
  1127.        io_Message      mn_ReplyPort set
  1128.        io_Device       preset by OpenDevice
  1129.        io_Unit         preset by OpenDevice
  1130.        io_Command      PRD_PRTCOMMAND
  1131.        io_PrtCommand   the actual command number
  1132.        io_Parm0        parameter for the command
  1133.        io_Parm1        parameter for the command
  1134.        io_Parm2        parameter for the command
  1135.        io_Parm3        parameter for the command
  1136.  
  1137.    RESULTS
  1138.        Errors: if the PRD_PRTCOMMAND succeeded, then io_Error will be zero.
  1139.        Otherwise io_Error will be non-zero.  An error of -1 indicates that
  1140.        the command is not supported by the current printer driver.  This
  1141.        could be used to check if the connected printer supports a particular
  1142.        command (italics for example).
  1143.  
  1144.    SEE ALSO
  1145.        printer.device/PWrite() printer.h, parallel.device, Preferences
  1146. printer.device/PRD_QUERY                             printer.device/PRD_QUERY
  1147.  
  1148.    NAME
  1149.     PRD_QUERY -- query printer port/line status
  1150.  
  1151.    FUNCTION
  1152.     This command returns the status of the printer port's lines and
  1153.     registers.  Since the printer port uses either the serial or
  1154.     parallel port for i/o, the actual status returned is either the
  1155.     serial or parallel port's status.
  1156.  
  1157.    IO REQUEST
  1158.     io_Message    mn_ReplyPort set if quick I/O is not possible
  1159.     io_Device    preset by the call to OpenDevice
  1160.     io_Command    PRD_QUERY
  1161.     io_Data        ptr to 2 UBYTES where result will be stored.
  1162.  
  1163.    RESULTS
  1164.      io_Data          BIT  ACTIVE  FUNCTION (SERIAL DEVICE)
  1165.  
  1166.              LSB       0    low    reserved
  1167.                        1    low    reserved
  1168.                        2    low    reserved
  1169.                        3    low    Data Set Ready
  1170.                        4    low    Clear To Send
  1171.                        5    low    Carrier Detect
  1172.                        6    low    Ready To Send
  1173.                        7    low    Data Terminal Ready
  1174.              MSB       8    high   read buffer overflow
  1175.                        9    high   break sent (most recent output)
  1176.                       10    high   break received (as latest input)
  1177.                       11    high   transmit x-OFFed
  1178.                       12    high   receive x-OFFed
  1179.                    13-15           reserved
  1180.  
  1181.  
  1182.      io_Data          BIT  ACTIVE  FUNCTION (PARALLEL DEVICE)
  1183.  
  1184.                        0     hi     printer busy (offline)
  1185.                        1     hi     paper out
  1186.                        2     hi     printer selected
  1187.                      (WARNING: the bit 2 line is also connected
  1188.                       to the serial port's ring indicator pin
  1189.                       on the A500 and A2000)
  1190.                      3-7            reserved
  1191.  
  1192.      io_Actual       1-parallel, 2-serial
  1193. printer.device/PRD_RAWWRITE                       printer.device/PRD_RAWWRITE
  1194.  
  1195.    NAME
  1196.     PRD_RAWWRITE -- transparent write command
  1197.  
  1198.    FUNCTION
  1199.     This is a non standard write command that performs no
  1200.     processing on the data passed to it.
  1201.  
  1202.    IO REQUEST
  1203.     io_Message    mn_ReplyPort set if quick I/O is not possible
  1204.     io_Command    PRD_RAWWRITE
  1205.     io_Flags    IOB_QUICK set if quick I/O is possible
  1206.     io_Length    the number of bytes in io_Data
  1207.     io_Data        the raw bytes to write to the printer
  1208. printer.device/PRD_READPREFS                     printer.device/PRD_READPREFS
  1209.  
  1210.    NAME
  1211.     PRD_READPREFS - read the current driver preferences in a buffer (V44)
  1212.  
  1213.    FUNCTION
  1214.     This is a non standard read command that reads the driver 
  1215.     preferences.
  1216.  
  1217.    IO REQUEST
  1218.     io_Message    mn_ReplyPort set if quick I/O is not possible
  1219.     io_Command    PRD_READPREFS
  1220.     io_Flags    IOB_QUICK set if quick I/O is possible
  1221.     io_Length    the size of the buffer in io_Data
  1222.     io_Data        a buffer
  1223.     io_Actual    the number of bytes copied to the buffer.
  1224.     
  1225.     If the read fails because the buffer is too small you should double
  1226.     the size of the buffer and try it again.
  1227.     
  1228.     Never interpret the contents of the buffer. You are allowed to save
  1229.     it to file (as one block of data) and of course to write it back to
  1230.     the driver (PRD_WRITEPREFS).
  1231.     
  1232.     If you close the printer device between PRD_EDITPREFS and the
  1233.     actual printing (CMD_WRITE or PRD_DUMPRPORTTAGS) you must read
  1234.     the prefs after PRD_EDITPREFS and write it back before printing
  1235.     or the driver may forget the user changes.
  1236. printer.device/PRD_SETERRHOOK                   printer.device/PRD_SETERRHOOK
  1237.  
  1238.    NAME
  1239.     PRD_SETERRHOOK -- set a hook for error messages (V44)
  1240.  
  1241.    FUNCTION
  1242.     This command sets a hook that will be called if the printer.device
  1243.     returns with an error from any other I/O command. This allows
  1244.     printer drivers to use private error messages.
  1245.  
  1246.    IO REQUEST
  1247.     io_Message    mn_ReplyPort set if quick I/O is not possible
  1248.     io_Device    preset by the call to OpenDevice
  1249.     io_Command    PRD_SETERRORHOOK
  1250.     io_Hook        a pointer to a hook that will be called
  1251.     
  1252.     Two standard hook values a defined:
  1253.     
  1254.     PDHOOK_NONE    no error hook is to be used
  1255.     PDHOOK_STD    EasyRequest() is used to display the error message
  1256.     
  1257.     The hook gets a pointer to the IORequest that caused the error as
  1258.     the object and a pointer to the following structure as message:
  1259.     
  1260. struct PrtErrMsg {
  1261.     ULONG pe_Version;
  1262.     ULONG pe_ErrorLevel;
  1263.     struct Window *pe_Window; /* window for EasyRequest() */
  1264.     struct EasyStruct *pe_ES;
  1265.     ULONG *pe_IDCMP;
  1266.     APTR pe_ArgList;
  1267. };
  1268.     pe_Version    the message version number PDHOOK_VERSION
  1269.     pe_ErrorLevel    one of RETURN_WARN, RETURN_ERROR, RETURN_FAIL
  1270.     pe_Window    a window pointer (for EasyRequest()) or NULL
  1271.     pe_ES        a pointer to the error message structure
  1272.     pe_IDCMP    a pointer to IDCMP Flags for EasyRequest()
  1273.     pe_ArgList    a pointer to an array of arguments
  1274.     
  1275.     The simplest case is to use that structure to call EasyRequest()
  1276.     or to printf() a message to a console (use the error message from
  1277.     pe_ES and the pe_ArgList).
  1278.     
  1279. printer.device/PRD_WRITEPREFS                   printer.device/PRD_WRITEPREFS
  1280.  
  1281.    NAME
  1282.     PRD_WRITEPREFS - write the current driver prefs from a buffer (V44)
  1283.  
  1284.    FUNCTION
  1285.     This is a non standard write command that writes the driver 
  1286.     preferences.
  1287.  
  1288.    IO REQUEST
  1289.     io_Message    mn_ReplyPort set if quick I/O is not possible
  1290.     io_Command    PRD_WRITEPREFS
  1291.     io_Flags    IOB_QUICK set if quick I/O is possible
  1292.     io_Length    the length of the buffer
  1293.     io_Data        a buffer
  1294.     io_Actual    the number of bytes copied to the driver prefs.
  1295.     
  1296.     The printer driver checks the buffer before copying it to its
  1297.     preferences. So you don't have to worry about changing the printer
  1298.     driver between PRD_READPREFS and PRD_WRITEPREFS.
  1299. printer.device/PQuery                                   printer.device/PQuery
  1300.  
  1301.    NAME
  1302.     PQuery - read number of chars in input buffer
  1303.  
  1304.    SYNOPSIS
  1305.     error = (*PrinterData->pd_PQuery)(*length);
  1306.     D0
  1307.     
  1308.     LONG PRead(LONG *);
  1309.  
  1310.    FUNCTION
  1311.        PQuery reads the number of data in the input buffer which can be
  1312.        read from the printer port. The variable length points to is set
  1313.        to the number of readable chars.
  1314. printer.device/PRead                                     printer.device/PRead
  1315.  
  1316.    NAME
  1317.     PRead - internal read from printer port
  1318.  
  1319.    SYNOPSIS
  1320.     error = (*PrinterData->pd_PRead)(buffer, length, tv);
  1321.     D0
  1322.     
  1323.     LONG PRead(UBYTE *, ULONG *, struct timeval *);
  1324.  
  1325.    FUNCTION
  1326.     PRead reads a buffer of data from the printer port. The variable
  1327.     length points to is set to the actual number of read bytes.
  1328.     
  1329.     tv points to a struct timeval or is NULL in which case the default
  1330.     time is PrinterExtendedData.ped_TimeoutSecs. If the time of tv 
  1331.     ellapes before the CMD_READ at the printer port is done two different
  1332.     things may happen: If at least one char is read PRead() returns. If
  1333.     no char is read but PQuery returns a value larger 0 the read is 
  1334.     repeated with that length to read all outstanding data.
  1335. printer.device/PWrite                                   printer.device/PWrite
  1336.  
  1337.    NAME
  1338.     PWrite -- internal write to printer port
  1339.  
  1340.    SYNOPSIS
  1341.     error = (*PrinterData->pd_PWrite)(buffer, length);
  1342.     D0
  1343.     
  1344.     LONG PWrite(UBYTE *, ULONG);
  1345.  
  1346.    FUNCTION
  1347.     PWrite writes 'length' bytes directly to the printer.  This
  1348.     function is generally called by printer drivers to send
  1349.     their buffer(s) to the printer.
  1350.  
  1351.     This function is accessed by referencing off the PrinterData (PD)
  1352.     structure.  Below is a code fragment to show how to do get access
  1353.     to a pointer to the PrinterData (PD) structure.
  1354.  
  1355.     #include <exec/types.h>
  1356.     #include <devices/printer.h>
  1357.     #include <devices/prtbase.h>
  1358.  
  1359.     struct IODRPReq PReq;
  1360.     struct PrinterData *PD;
  1361.     struct PrinterExtendedData *PED;
  1362.  
  1363.     /* open the printer device (any version); if it opened... */
  1364.     if (OpenDevice("printer.device", 0, &PReq, 0) == NULL) {
  1365.  
  1366.         /* get pointer to printer data structure */
  1367.         PD = (struct PrinterData *)PReq.io_Device;
  1368.  
  1369.         /* write something directly to the printer */
  1370.         (*PD->pd_PWrite)("Hello world\n", 12);
  1371.  
  1372.         CloseDevice(&PReq); /* close the printer device */
  1373.     }
  1374.